#pragma once

#ifndef GRAPHSCENE_H
#define GRAPHSCENE_H

#include <QGraphicsScene>

QT_BEGIN_NAMESPACE
class QFocusEvent;
class QGraphicsItem;
class QGraphicsSceneMouseEvent;
QT_END_NAMESPACE

class GraphScene : public QGraphicsScene
{
public:
	enum Mode { Move, AddClass, AddOperation, AddRelation, ReadOnly };

	GraphScene(void);
	~GraphScene(void);

	void setMode(Mode mode) { _mode = mode; }
	Mode mode() { return _mode; }

	void mouseMoveEvent(QGraphicsSceneMouseEvent *mouseEvent);
	void mousePressEvent(QGraphicsSceneMouseEvent *mouseEvent);
	void mouseReleaseEvent(QGraphicsSceneMouseEvent *mouseEvent);
private:
	QGraphicsLineItem *line;
	Mode _mode;
};

#endif // GRAPHSCENE_H